package 课程设计报告_hb_7_8;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author Jiang Zhiyan
 *
 * 2021年7月8日 上午11:48:32
 *
 */
public class ThreadPoolTest {
   public static void main(String[] args) {
	ExecutorService threadPool =  Executors.newFixedThreadPool(2);
	  for(int i=0;i<5;i++) {
		  threadPool.submit(new Runnable(){
			  @Override
			 public void run() {
				System.out.println(Thread.currentThread().getName()+ " dosomething ...");
			}
		  });
	  }
	  threadPool.shutdown();
}
}
